package org.amos.gateway.config;

import org.amos.gateway.handler.SentinelExceptionHandler;
import org.amos.gateway.handler.SentinelPersistHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * @desc: 网关配置
 * @author: liubt
 * @date: 2020-12-17 15:28
 **/
@Configuration
public class GatewayConfig {
    @Bean
    @Order(Ordered.HIGHEST_PRECEDENCE)
    public SentinelExceptionHandler sentinelGatewayExceptionHandler() {
        return new SentinelExceptionHandler();
    }

    @Bean
    public SentinelPersistHandler sentinelPersistHandler() {
        return new SentinelPersistHandler();
    }
}
